#include <sstream> 

#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Length.h>
#include <CascadeFormate.h>
#include <InchFormate.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS
using namespace std;
#if 0
Length(35, INCH) -> 2 FEET 11 INCH
Length(38, INCH) -> 1 YARD 2 INCH
Length(48, INCH) -> 1 YARD 1 FEET
Length(5, FEET) -> 1 YARD 2 FEET 
Length(1781, YARD) -> 1 MILE 21 YARD


#endif

FIXTURE(Length)
{

	TEST(1 yard equal to  3 feet)
	{
		ASSERT_EQ(Length(1, YARD),Length(3, FEET)); 
	}


	TEST(1 mile equal to 1760 yard)
	{
		ASSERT_EQ(Length(1, MILE),Length(1760, YARD)); 
	}


	TEST(1 feet + 1 yard + 1 mile is equal to 5284 feet)
	{
		ASSERT_EQ(Length(1, FEET) + Length(1, YARD) + Length(1, MILE), Length(5284, FEET)); 
	}

	TEST(35 INCH should be formated as "2 FEET 11 INCH")
	{
		ASSERT_EQ(Length(35, INCH).formate(normalFormate), "2 FEET 11 INCH");
	}

	TEST(38 INCH should be formated as "1 YARD 2 INCH")
	{
		ASSERT_EQ(Length(38, INCH).formate(normalFormate), "1 YARD 2 INCH");
	}

	TEST(48 INCH should be formated as "1 YARD 1 FEET")
	{
		ASSERT_EQ(Length(48, INCH).formate(normalFormate), "1 YARD 1 FEET");
	}

	TEST(5 FEET should be formated as "1 YARD 2 FEET")
	{
		ASSERT_EQ(Length(5, FEET).formate(normalFormate), "1 YARD 2 FEET");
	}

	TEST(1781 YARD should be formated as "1 MILE 21 YARD")
	{
		ASSERT_EQ(Length(1781, YARD).formate(normalFormate), "1 MILE 21 YARD");
	}

	TEST(2 INCH should be formated as "2 INCH")
	{
		ASSERT_EQ(Length(2, INCH).formate(inchFormate), "2 INCH");
	}


	TEST(2 FEET should be formated as "24 INCH")
	{
		ASSERT_EQ(Length(2, FEET).formate(inchFormate), "24 INCH");
	}


	TEST(3 YARD should be formated as "108 INCH")
	{
		ASSERT_EQ(Length(3, YARD).formate(inchFormate), "108 INCH");
	}


	TEST(2 MILE should be formated as "126720 INCH")
	{
		ASSERT_EQ(Length(2, MILE).formate(inchFormate), "126720 INCH");
	}


};
